const express=require('express')
const router=express.Router()

const {Cate}=require('../models')
// 获取分类数据的api
router.get('/home/cates',async (req,res)=>{
     try{
         const cates = await Cate.findAll({
             order: [
                 ['sort', 'desc']
             ]
         })
         return res.cc(200, 'success', cates)
     }catch(e){
         return res.cc(400,e.message)
     }
      
})





module.exports =router